/* eslint valid-jsdoc: "off" */

"use strict";

/**
 * @param {Egg.EggAppInfo} appInfo app info
 */

 
module.exports = (appInfo) => {
  /**
   * built-in config
   * @type {Egg.EggAppConfig}
   **/
  const config = (exports = {});

  // use for cookie sign key, should change to your own and keep security
  config.keys = appInfo.name + "_1650326606078_4495";

  // add your middleware config here
  config.middleware = [];

  // add your user config here
  const userConfig = {
    // myAppName: 'egg',
  };

  config.mysql = {
    // 单数据库信息配置
    client: {
      // host
      host: "localhost",
      // 端口号
      port: "3306",
      // 用户名
      user: "root",
      // 密码
      password: "root",
      // 数据库名
      database: "shixuner",
    },
    // 是否加载到 app 上，默认开启
    app: true,
    // 是否加载到 agent 上，默认关闭
    agent: false,
  };

  // 允许跨域
  config.cors = {
    origin: "*",
    allowMethods: "GET,HEAD,PUT,POST,DELETE,PATCH",
  };

  //关闭安全 csrf
  config.security = {
    csrf: {
      enable: false,
    },
  };

  // 解析前端传递file格式文件
  config.multipart = {
    mode: "file",
  };

  config.mediaServer = {
    // rtmp 数据流
    rtmp: {
      port: 1935, //默认端口号
      chunk_size: 60000, //数据流大小
      gop_cache: true,
      ping: 60, //ping值
      ping_timeout: 30, //ping值延时效果
    }, // http数据流

    http: {
      port: 8000,
      allow_origin: "*",
    },
  };

  return {
    ...config,
    ...userConfig,
  };
};
